<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>简单loading加载动画</title>
  </head>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    html,
    body {
      width: 100%;
      height: 100%;
    }
    .loading-box {
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.2);
    }
    .loading {
      width: 200px;
      height: 114px;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
    .loading div {
      width: 20px;
      height: 20px;
      background: #fff;
      border-radius: 50%;
      display: inline-block;
      animation: loading 2s linear infinite;
      margin: 10px;
    }
    .loading div:nth-child(1) {
      animation-delay: 0.2s;
    }
    .loading div:nth-child(2) {
      animation-delay: 0.4s;
    }
    .loading div:nth-child(3) {
      animation-delay: 0.6s;
    }
    .loading div:nth-child(4) {
      animation-delay: 0.8s;
    }
    @keyframes loading {
      0% {
        transform: scale(1)
      }
      25% {
        transform: scale(1.25)
      }
      50% {
        transform: scale(1.5)
      }
      75% {
        transform: scale(1.25)
      }
      100% {
        transform: scale(1)
      }
    }
  </style>
  <body>
    <div class="loading-box">
      <div class="loading">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
      </div>
    </div>
  </body>
</html>
